import { Tabbar } from 'vant'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      alias:'/film',//别名
      redirect:'/nowPlaying',
      
      components:{        
        default:()=>import("@/views/film/index.vue"),
        tabbar:()=>import("@/views/tabbar/index.vue"),
      },
      children:[
        {
          path:'nowPlaying',component:()=>import('@/views/film/components/nowPlaying.vue')
        },
        {
          path:'comeSoon',component:()=>import('@/views/film/components/comeSoon.vue')
        },
      ]
       
      
    },
    {
      path:'/cinema',
      components:{        
        default:()=>import("@/views/cinema/index.vue"),
        tabbar:()=>import("@/views/tabbar/index.vue"),
      }
    },
    {
      path:'/my',
      components:{        
        default:()=>import("@/views/my/index.vue"),
        tabbar:()=>import("@/views/tabbar/index.vue"),
      }
    },
    {
      path:'/random',
      components:{        
        default:()=>import("@/views/random/index.vue"),
        tabbar:()=>import("@/views/tabbar/index.vue"),
      }
    },
    {
      path:'/login',
      component:()=>import("@/views/login/index.vue")
    }
  ]
})

export default router
